
package com.uchedao.seller.module.car;

import android.text.TextUtils;

import java.io.Serializable;

/**
 * 车系的模型
 * 
 * @author Administrator
 */
public class CarSeries implements Serializable {
    /**
     * 序列化ID
     */
    private static final long serialVersionUID = 1L;

    /**
     * 车系Id号
     */
    private int id = 0;

    /**
     * 车系名称
     */
    private String full_name = "";

    /**
     * 车系全拼
     */
    private String full_spell = "";

    /**
     * 首字母
     */
    private String initial = "";

    /**
     * 品牌Id号
     */
    private int brand_id = 0;

    /**
     * 车辆类型Ids
     */
    private String types = "";

    /** 车辆是否进口的标志 */
    private int import_id = 0;

    public CarSeries() {
        super();
    }

    public CarSeries(int id, int brandId, String name, String spell) {
        super();
        this.id = id;
        this.brand_id = brandId;
        this.full_name = name;
        this.full_spell = spell;
        if (!TextUtils.isEmpty(spell.trim())) {
            this.initial = spell.trim().substring(0, 1).toUpperCase();
        } else if (!TextUtils.isEmpty(full_name.trim()) && TextUtils.isEmpty(initial)) {
            this.initial = full_name.trim().substring(0, 1).toUpperCase();
        }
    }

    public int getImportId() {
        return import_id;
    }

    public void setImportId(int importId) {
        this.import_id = importId;
    }

    public String getTypeIds() {
        return types;
    }

    public void setTypeIds(String typeIds) {
        this.types = typeIds;
    }

    public String getInitial() {
        return initial;
    }

    public void setInitial(String initial) {
        this.initial = initial;
    }

    public int getBrandId() {
        return brand_id;
    }

    public void setBrandId(int brandId) {
        this.brand_id = brandId;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return full_name;
    }

    public void setName(String name) {
        this.full_name = name;
    }

    public String getSpell() {
        return full_spell;
    }

    public void setSpell(String spell) {
        this.full_spell = spell;
        if (spell.length() > 0) {
            this.initial = spell.trim().substring(0, 1).toUpperCase();
        } else if (full_name.length() > 0) {
            this.initial = full_name.trim().substring(0, 1).toUpperCase();
        }
    }

    @Override
    public String toString() {
        return "CarFamily [brandId=" + brand_id + ",id=" + id + ", name=" + full_name + ", spell="
                + full_spell + "]";
    }

}
